<?php
class PayLogDao {
	private $table = 'pay_log';
	public function add($data){
		return ClassManager::getSql()->insert($this->table, $data);
	}
	public function update($data,$id){
		ClassManager::getSql()->update($this->table, $data,"where id='".intval($id)."'");
	}
	
	public function get($id){
		return ClassManager::getSql()->oneDataCache($this->table, 'id', intval($id));
	}
	
	public function searchList($where,$order='',$limit=0){
		$where = $this->searchWhere($where);
		return ClassManager::getSql()->dataList1($this->table,'*',$where,$order,$limit);
	}
	

	public function searchWhere($where){
		$likeWhere = array();
		foreach ($where as  $k=>$v){
			if (isset($v)&&$v!==""){
				if (in_array($k,$likeWhere) and !is_array($v)){
					$where1[$k] = array('%'.$v.'%' , 'like');
				}
				else{
					$where1[$k] = $v;
				}
			}
		}
		return $where1;
	}	
}

?>